﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;

namespace FinalShellOffLineActivate
{
    public class CalculateHash
    {
        public static string CalculateKeccak384Hash(string input)
        {
            KeccakDigest digest = new KeccakDigest(384);
            byte[] inputBytes = Encoding.UTF8.GetBytes(input);
            byte[] output = new byte[digest.GetDigestSize()];

            digest.BlockUpdate(inputBytes, 0, inputBytes.Length);
            digest.DoFinal(output, 0);
            return HexEncoder.ToHexString(output);
        }
        public static string Md5(string input)
        {
            byte[] result = Encoding.Default.GetBytes(input);
            MD5 md5 = new MD5CryptoServiceProvider();
            byte[] output = md5.ComputeHash(result);
            return BitConverter.ToString(output).Replace("-", "");
        }
    }
}
